elect = "US Elections 101: 20 things you should absolutely know about this poll battle"
Elect = elect.upper()
print('Upper:', Elect)
nElect = elect.lower()
print('Lower', nElect)

print('All upper letters: ', end=': ')
for a in elect:
    if a.isupper():
        print(a, end=', ')
print()

print('All digits: ', end=': ')
for a in elect:
    if a.isdigit():
        print(a, end=', ')
print()

print('Count of letter \'o\'', end=': ')
cnt = 0
for a in elect:
    if 'o' == a.lower():
        cnt += 1
print(cnt)

if -1 == elect.find('battle'):
    w = '没有'
else:
    w = '有'
print('句子中', w, 'battle一词。', sep='')

print('将battle一词替换后，句子是：', elect.replace('battle', '***').replace('Battle', '***').replace('BATTLE', '***'))
